﻿using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.Util;
using System;
using System.ComponentModel;

namespace PMAF.K3Cloud.SCM.Bill.BusinessPlugIn
{
    [HotUpdate]
    [Description("标准应付单勾选税额计入成本")]
    public class PayAble : AbstractBillPlugIn
    {
        public override void AfterBindData(EventArgs e)
        {
            base.AfterBindData(e);
            //单据类型
            DynamicObject billType = (DynamicObject)View.Model.GetValue("FBillTypeID");
            string billTypeId = billType["Id"].ToString();
            //单据类型为标准应付单
            if(string.Equals(billTypeId, "a83c007f22414b399b0ee9b9aafc75f9"))
            {
                //勾选税额计入成本并刷新
                View.Model.SetValue("FISTAXINCOST", true);
                View.UpdateView("FISTAXINCOST");
            }
        }
    }
}
